<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
  xmlns="http://schemas.microsoft.com/wix/2006/wi"
  exclude-result-prefixes="wix"
>

  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="text()|*|@*" />
    </xsl:copy>
  </xsl:template>

  <xsl:template match="wix:Fragment">
    <?include Vars.wxi?>
    <Fragment>
      <xsl:apply-templates />
    </Fragment>
  </xsl:template>

  <xsl:template match="wix:DirectoryRef">
    <DirectoryRef Id="INSTALLFOLDER">
      <xsl:apply-templates    />
    </DirectoryRef>
  </xsl:template>

  <xsl:template match="wix:DirectoryRef/wix:Directory">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="wix:Component">
    <xsl:if test="@Id != 'Kadastr.Charger.Service.exe'">
      <Component Id="{@Id}" Guid="{@Guid}">
        <File Id="{wix:File/@Id}" Source="{concat('..\Sklad.WindowsApplication\bin\Debug', substring(wix:File/@Source, 10))}"/>
      </Component>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>

<!---->
